package com.example.springbootdemo.enums;

/**
 * @Author: ShengXiaJia
 * @Date: 2019/12/4 10:35
 * @Description: 通用的结果返回类
 */
public enum JsonValueEnum {

    SUCCESS(0, "success", "成功"),

    /* [1***]参数不合法 */
    NULL(1001, "A required parameter is blank", "有必填项为空"),
    PARAMETER_ILLEGAL(1002, "There are invalid parameters", "有不合法的参数存在"),
    REPETITION_DATA(1003, "Duplicate data, mandatory data already exists in the system", "重复的数据,有必填项数据在系统中已存在"),

    /* [2***]程序处理异常 */
    EXCEPTION(2001, "exception", "程序异常"),
    ERROR(2002, "ERROR", "程序错误");

    /* [3***]不合法的人为操作 */

    /* [4***]Filter 拦截 */

    private int code;

    private String descEnglish;

    private String descChinese;

    JsonValueEnum(int code, String descEnglish, String descChinese) {
        this.code = code;
        this.descEnglish = descEnglish;
        this.descChinese = descChinese;
    }

    public int getCode() {
        return code;
    }

    public String getDescEnglish() {
        return descEnglish;
    }

    public String getDescChinese() {
        return descChinese;
    }

}